package edu.gyc.book.service;

import edu.gyc.book.dao.BookMapper;
import edu.gyc.book.dao.CategoryMapper;
import edu.gyc.book.model.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService{

    @Autowired
    CategoryMapper categoryDao;

    @Override
    public List<Category> getCategoryList() {

        return categoryDao.getAllCategory();
    }

    @Override
    public Category getCategoryById(Integer id) {
        Category category = categoryDao.selectByPrimaryKey(id);
        return category;
    }
}
